home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / B7T12.ZIP;1 / B7T-DEMO.BAS next >
Encoding:
BASIC Source File  |  1993-01-11  |  27.0 KB  |  611 lines

  1. '----------------------------------------------------------------------------
  2. '                         **    B7T-DEMO.BAS    **
  3. '      Demonstration of the capabilities of the B7Tool Library routines
  4. '       Written for and compiled with Microsoft (R), BASIC 7.x PDS (C)
  5. '                        By R. J. Crouch  -  May 1992
  6. '                     Copyright  -  1992-93  -  CareWare
  7. '                            All Rights Reserved
  8. '----------------------------------------------------------------------------
  9.  
  10. REM $INCLUDE: 'B7T.BI'                            ' Contains declarations for
  11.                                                   '  Ctr() and Delay()
  12. DEFINT A-Z
  13.  
  14. TYPE RegType                                      ' Necessary for the CALL to
  15.    ax    AS INTEGER                               ' QB's Interrupt() routine
  16.    bx    AS INTEGER                               ' used to clear the screen
  17.    cx    AS INTEGER                               ' at end of demo
  18.    dx    AS INTEGER                               ' Generally placed in the
  19.    bp    AS INTEGER                               ' "$INCLUDE:" file
  20.    si    AS INTEGER                               '
  21.    di    AS INTEGER                               '
  22.    flags AS INTEGER                               '
  23. END TYPE                                          '
  24.                                                   
  25. DIM InReg AS RegType, OutReg AS RegType               ' Typed for Interrupt()
  26. DIM Menu(5, 4) AS STRING                        ' Array for BarMenu() routine
  27. DIM ScrnBuf(8) AS STRING * 4000                          ' Room for 9 screens
  28.                                                          '  w/ option base 0
  29. FALSE = 0: TRUE = NOT FALSE                                           ' Flags
  30. CONST CONT = "Press any key to continue..."                         ' Prompts
  31. CONST MCONT = "Left mouse button to continue..."                    '
  32.  
  33. Menu(0, 0) = "0303020401"          '<== Contains upper limits of each 2nd dim-
  34.                                       ' ension for each 1st dimension of any
  35. Menu(1, 0) = " Menu Item #1 "         ' menu array.  The field for each value
  36. Menu(1, 1) = " Select Item #1 "       ' is 2 characters in length.
  37. Menu(1, 2) = " Do Item #2     "       '
  38. Menu(1, 3) = " Pick Item #3   "       '     1st Dim      1   2   3   4   5
  39.                                       '
  40. Menu(2, 0) = " Item #2 "              '  # of level 2   03  03  02  04  01
  41. Menu(2, 1) = " #1           "         '  menu items
  42. Menu(2, 2) = " Level 2 - #2 "         '
  43. Menu(2, 3) = " #3           "         ' 2nd dim. of any menu array must be as
  44.                                       ' large as the largest 1st dim. set.
  45. Menu(3, 0) = " Level #1 Item #3 "     ' ie.  since 1st dim. 4 of Menu() has 4
  46. Menu(3, 1) = " Pick Item #1      "    ' 2nd dim. items - Menu() must be DIMed
  47. Menu(3, 2) = " Show This Item #2 "    ' DIM Menu(5, 4) AS STRING
  48.                                       '             |-- largest number of 2nd
  49. Menu(4, 0) = " Selection #4 "         '                 dimension items
  50. Menu(4, 1) = " Sub Menu Item #1  " '<== The window width of the level 2 menu
  51. Menu(4, 2) = " Sub Item #2       "    ' is determined by the length of ele-
  52. Menu(4, 3) = " Sub Level Item #3 "    ' ment 1 of the 2nd dim.  All strings
  53. Menu(4, 4) = " Sub Menu Item #4  "    ' should be as long as the longest item
  54.                                       ' title.  Spaces at start and end of
  55. Menu(5, 0) = " Quit "                 ' string are not required, but present a
  56. Menu(5, 1) = " Exit Menu Demo "       ' better looking menu when highlighting.
  57.  
  58. b1$ = CHR$(221) + " ": b2$ = " " + CHR$(222)                       ' Brackets
  59. cpyr$ = b1$ + "Copyright - 1992-93 - CareWare" + b2$
  60. mpos1$ = b1$ + "Row ## - Col ##" + b2$                         ' Formats for
  61. mpos2$ = b1$ + "Y ###  -  X ###" + b2$                         '  PRINT USING
  62. buttons = 0
  63.                                     
  64. 'ON KEY(10) GOSUB Terminate                                 ' For programming
  65. 'KEY(10) ON                                                 '  purposes only
  66.  
  67. '----------------------------------------------------------------------------
  68. 'Title Screen
  69. '----------------------------------------------------------------------------
  70.  
  71.    CALL GetVideo(VMode, VPage, VCol, CStrt, CStp, CAtt)
  72.    COLOR 7, 0, 0: CLS
  73.    CALL DoWindow(1, 3, 25, 76, 103, 5, 0, "B7Tool Demo - Ver. 1.2a", 2)
  74.    CALL PrtScrn(cpyr$, 25, 24, 103)
  75.    CALL DoWindow(3, 13, 16, 56, 15, 5, 3, CONT, 3)
  76.    FOR row = 5 TO 14
  77.       READ line$: lctr = Ctr(line$) + 1
  78.       IF row < 8 THEN att = 12 ELSE att = 14
  79.       CALL PrtScrn(line$, row, lctr, att)
  80.    NEXT row
  81.    READ line$
  82.    CALL PrtScrn(line$, row + 1, lctr, 10)
  83.    CALL PrtScrn("€flflfi € €", 21, 11, 103)
  84.    CALL PrtScrn("€‹‹fi‹€‹€", 22, 11, 103)
  85.    CALL PrtScrn("Software", 23, 11, 103)
  86.    CALL PrtScrn("by  R. J. Crouch", 21, 55, 103)
  87.    CALL PrtScrn("Member", 22, 65, 103)
  88.    CALL PrtScrn(" ssociation of  hareware  rofessionals", 23, 33, 103)
  89.    CALL PrtScrn("A", 23, 33, 96)
  90.    CALL PrtScrn("S", 23, 48, 96)
  91.    CALL PrtScrn("P", 23, 58, 96)
  92.    CALL PutScrn(ScrnBuf(0))
  93.    WHILE INKEY$ = "": WEND                       ' Typical wait for key press
  94.    CALL MouseStatus(have)                         ' Check for mouse interrupt
  95.    IF have THEN                                            ' Ask to use mouse
  96.       CALL DoWindow(7, 16, 12, 49, 12, 1, 0, "", 0)
  97.       CALL MouseVersion(ver$)
  98.       FOR row = 9 TO 14
  99.          READ line$
  100.          lcrt = Ctr(line$)
  101.          CALL PrtScrn(line$, row, lctr, 14)
  102.          IF row = 10 THEN
  103.             CALL PrtScrn(ver$, row, lctr + 26, 10)
  104.             CALL PrtScrn(".", row, lctr + 26 + LEN(ver$), 14)
  105.          END IF
  106.       NEXT row
  107.       finish! = TIMER + 30
  108.       DO
  109.          i$ = UCASE$(INKEY$)                                   ' Wait for key
  110.          now! = TIMER                                          '  or 30 sec.
  111.       LOOP UNTIL i$ = "N" OR i$ = "Y" OR now! > finish!
  112.       IF i$ = "Y" THEN                              ' Initialize mouse driver
  113.          prompt$ = MCONT: pctr = Ctr(MCONT)                ' Use mouse prompt
  114.          CALL MouseReset(buttons)                       ' Return # of buttons
  115.          Mouse = TRUE
  116.       ELSE                                                 ' Mouse not wanted
  117.          prompt$ = CONT: pctr = Ctr(CONT)                    ' Use key prompt
  118.          Mouse = FALSE
  119.       END IF
  120.       CALL PrtScrn(prompt$, 16, pctr, 10)
  121.       CALL Delay(30, 0, Mouse)
  122.    ELSE                                                   ' No mouse detected
  123.       FOR x = 1 TO 6: READ nul$: NEXT x                ' Skip mouse text data
  124.    END IF
  125.    CALL GetScrn(ScrnBuf(0))                         ' Retrieve opening screen
  126.    IF Mouse THEN CALL PrtScrn(b1$ + prompt$ + b2$, 18, pctr - 2, 15)
  127.    CALL Delay(60, 0, Mouse)
  128.    CLS
  129.    CALL DoWindow(8, 14, 9, 53, 13, 5, 3, prompt$, 3)
  130.    FOR row = 11 TO 13
  131.       READ line$: lctr = Ctr(line$)
  132.       CALL PrtScrn(line$, row, lctr, 15)
  133.    NEXT row
  134.    CALL Delay(60, 0, Mouse)
  135.  
  136. '----------------------------------------------------------------------------
  137. 'Frame types and screen save/restore
  138. '----------------------------------------------------------------------------
  139.  
  140.    COLOR 0, 0, 0: CLS
  141.    col = 0: frm = -1: scrn = -1
  142.    bgd = 0: fgd = 15
  143.    FOR row = 2 TO 14 STEP 3
  144.       col = col + 6: bgd = bgd + 1
  145.       frm = frm + 1: fgd = fgd - 1
  146.       watt = (bgd * 16) + fgd
  147.       CALL DoWindow(row, col, 10, 20, watt, frm, 0, "Window", 2)
  148.       scrn = scrn + 1
  149.       CALL PutScrn(ScrnBuf(scrn))                   ' Screen save w/PutScrn()
  150.    NEXT row
  151.    FOR row = 11 TO 2 STEP -3
  152.       col = col + 6: bgd = bgd + 1
  153.       frm = frm + 1: fgd = fgd - 1
  154.       IF frm = 6 THEN frm = 1
  155.       IF bgd = 9 THEN bgd = 1
  156.       watt = (bgd * 16) + fgd
  157.       CALL DoWindow(row, col, 10, 20, watt, frm, 0, "B7Tool", 3)
  158.       IF scrn < 8 THEN                             ' Save all but last screen
  159.          scrn = scrn + 1
  160.          CALL PutScrn(ScrnBuf(scrn))             ' Save screens for later use
  161.       END IF
  162.    NEXT row
  163.    FOR row = 3 TO 9
  164.       READ line$
  165.       CALL PrtScrn(line$, row, col + 2, 31)
  166.    NEXT row
  167.    CALL PrtScrn(prompt$, 25, pctr, 10)
  168.    CALL Delay(60, 0, Mouse)
  169.    CALL DoWindow(9, 12, 7, 56, 15, 5, 0, "", 3)
  170.    FOR row = 11 TO 13
  171.       READ line$: lctr = Ctr(line$)
  172.       CALL PrtScrn(line$, row, lctr, 10)
  173.    NEXT row
  174.    CALL Delay(60, 0, Mouse)
  175.    FOR show = 7 TO 0 STEP -1
  176.       CALL GetScrn(ScrnBuf(show))                    ' Retrieve saved screens
  177.    NEXT show
  178.    FOR row = 5 TO 7
  179.       CALL PrtScrn("*  Fast  *", row, 11, 16)
  180.    NEXT row
  181.    CALL Delay(2, 0, Mouse)
  182.    CALL DoWindow(10, 12, 7, 56, 15, 5, 0, prompt$, 3)
  183.    FOR row = 12 TO 13
  184.       READ line$: lctr = Ctr(line$)
  185.       CALL PrtScrn(line$, row, lctr, 10)
  186.    NEXT row
  187.    CALL Delay(60, 0, Mouse)
  188.    FOR show = 1 TO 8
  189.       CALL GetScrn(ScrnBuf(show))                ' Screen restore w/GetScrn()
  190.       CALL Delay(.33, 0, Mouse)                        '  .33 second delay added
  191.    NEXT show
  192.    CALL PrtScrn("Now a three", 5, 58, 31)
  193.    CALL PrtScrn("second pause", 7, 58, 31)
  194.    CALL Delay(3, 0, Mouse)
  195.    FOR show = 8 TO 0 STEP -1
  196.       CALL GetScrn(ScrnBuf(show))
  197.       CALL Delay(.33, 0, Mouse)
  198.    NEXT show
  199.    CALL DoWindow(2, 6, 10, 20, 116, 5, 0, "B7Tool", 2)
  200.    CALL PrtScrn("*  Next  *", 5, 11, 112)
  201.    CALL PrtScrn("Shadow Styles", 7, 10, 112)
  202.    CALL PrtScrn(prompt$, 25, pctr, 10)
  203.    CALL Delay(60, 0, Mouse)
  204.  
  205. '----------------------------------------------------------------------------
  206. 'Shadowing
  207. '----------------------------------------------------------------------------
  208.  
  209.    CLS
  210.    CALL DoWindow(1, 1, 25, 80, 57, 5, 0, prompt$, 3)
  211.    CALL DoWindow(2, 21, 3, 38, 112, 1, 0, "", 0)
  212.    CALL DoWindow(6, 41, 18, 35, 17, 0, 0, "", 0)
  213.    READ line$: lctr = Ctr(line$)
  214.    CALL PrtScrn(line$, 3, lctr, 117)
  215.    FOR row = 7 TO 19 STEP 6                           ' print boxes w/shadows
  216.       FOR col = 8 TO 43 STEP 35
  217.          shadow = shadow + 1
  218.          back = back + 1
  219.          watt = (back * 16) + 14
  220.          IF row = 19 THEN                                         ' print x's
  221.             IF col = 8 THEN
  222.                FOR r = row TO row + 4
  223.                   CALL PrtScrn(STRING$(34, "x"), r, col - 3, 62)
  224.                NEXT r
  225.             ELSE
  226.                FOR r = row TO row + 4
  227.                   CALL PrtScrn(STRING$(34, "x"), r, col - 1, 30)
  228.                NEXT r
  229.                back = 3
  230.                watt = (back * 16) + 14
  231.             END IF
  232.          END IF
  233.          CALL DoWindow(row, col, 4, 30, watt, frame, shadow, "", 0)
  234.          frame = frame + 1
  235.          FOR x = row + 1 TO row + 2
  236.             READ line$
  237.             CALL PrtScrn(line$, x, col + 5, back * 16)
  238.          NEXT x
  239.       NEXT col
  240.       back = back + 1
  241.    NEXT row
  242.    CALL PutScrn(ScrnBuf(0))
  243.    CALL Delay(60, 0, Mouse)
  244.    CALL DoWindow(8, 9, 10, 62, 14, 5, 0, prompt$, 3)
  245.    FOR row = 10 TO 14
  246.       READ line$: lctr = Ctr(line$)
  247.       IF row < 12 THEN att = 15 ELSE att = 10
  248.       CALL PrtScrn(line$, row, lctr, att)
  249.    NEXT row
  250.    CALL Delay(60, 0, Mouse)
  251.    CALL GetScrn(ScrnBuf(0))
  252.    CALL DoWindow(11, 12, 7, 57, 11, 5, 0, prompt$, 3)
  253.    FOR row = 13 TO 14
  254.       READ line$
  255.       CALL PrtScrn(line$, row, 18, 15)
  256.    NEXT row
  257.    CALL Delay(60, 0, Mouse)
  258.  
  259. '----------------------------------------------------------------------------
  260. 'MenuDemo
  261. '----------------------------------------------------------------------------
  262.  
  263.    COLOR 1, 1, 0: CLS
  264.    DO
  265.       R1 = 2: R2 = 0
  266.       CALL PrtScrn("Use the arrow keys to highlight and press <ENTER> to select.", 12, 10, 31)
  267.       IF Mouse THEN
  268.          CALL PrtScrn("or", 13, 39, 31)
  269.          CALL PrtScrn("Roll your mouse to highlight and press the LEFT button to select.", 14, 8, 31)
  270.       END IF
  271.       CALL BarMenu(Menu(), 11, 4, 120, 112, 79, 6, Mouse, R1, R2)
  272.  
  273.       ' Generally placed after this CALL is some type of selectional
  274.       ' trapping.  The following remarked section outlines a brief example
  275.       ' of one type of system.  The number of CASEs required depends on the
  276.       ' number of items per menu level.
  277.       '
  278.       ' SELECT CASE R1                     Level #1
  279.       '    CASE 0
  280.       '       SELECT CASE R2               Level #2
  281.       '          CASE 0
  282.       '             <ESC> key or RIGHT mouse button pressed
  283.       '          CASE ELSE
  284.       '       END SELECT
  285.       '    CASE 1
  286.       '       SELECT CASE R2               Level #2
  287.       '          CASE 1
  288.       '             Do this
  289.       '          CASE 2
  290.       '             Do this instead
  291.       '          Etc...
  292.       '          CASE ELSE
  293.       '       END SELECT
  294.       '    CASE 2
  295.       '       SELECT CASE R2
  296.       '          CASE 1
  297.       '             Now do this
  298.       '          CASE 2
  299.       '             Do this instead
  300.       '          Etc...
  301.       '          CASE ELSE
  302.       '       END SELECT
  303.       '    Etc...
  304.       '    Etc...
  305.       '    CASE ELSE
  306.       ' END SELECT
  307.  
  308.       IF Mouse THEN CALL MouseVisible(0)
  309.       CALL DoWindow(8, 12, 11, 57, 6, 5, 0, prompt$, 3)
  310.       CALL PrtScrn("The following values were returned.", 11, 23, 14)
  311.       CALL PrtScrn("Level 1 menu item is ==>" + STR$(R1), 13, 27, 11)
  312.       CALL PrtScrn("Level 2 menu item is ==>" + STR$(R2), 15, 27, 11)
  313.       CALL Delay(0, 0, Mouse)
  314.       CALL DoWindow(8, 12, 11, 57, 17, 0, 0, "", 0)
  315.    LOOP UNTIL (R1 = 5 AND R2 = 1)
  316.    CLS
  317.    CALL DoWindow(9, 12, 7, 57, 13, 5, 0, prompt$, 3)
  318.    FOR row = 11 TO 12
  319.       READ line$
  320.       CALL PrtScrn(line$, row, 21, 15)
  321.    NEXT row
  322.    CALL Delay(60, 0, Mouse)
  323.  
  324. '----------------------------------------------------------------------------
  325. 'Equipment and System Information
  326. '----------------------------------------------------------------------------
  327.  
  328.    CALL GetDrive(DrvTot, CurDrv)
  329.    Avail& = CurDrv
  330.    CALL DriveSpc(Avail&)
  331.    CALL GetDOS(Dver$)
  332.    usefile$ = "B7T-DEMO.EXE"
  333.    CALL GetSize(usefile$, FSize&)
  334.    CALL GetComPorts(ComP)
  335.    CALL Get87(ins)
  336.    IF ins THEN CP$ = "Yes" ELSE CP$ = "No"
  337.    CALL DoWindow(3, 8, 20, 65, 7, 5, 0, "Equipment and System Information", 2)
  338.    CALL PrtScrn(b1$ + prompt$ + b2$, 22, pctr - 2, 7)
  339.    CALL PrtScrn("     The Current Drive:  " + CHR$(CurDrv + 64) + ":", 6, 21, 11)
  340.    CALL PrtScrn("Total Drives Installed: " + STR$(DrvTot), 7, 21, 11)
  341.    CALL PrtScrn("     Current Directory:  " + CURDIR$, 8, 21, 11)
  342.    CALL PrtScrn("  Disk Space Available: " + STR$(Avail&) + " Bytes", 9, 21, 11)
  343.    CALL PrtScrn("    Current Video Mode: " + STR$(VMode), 10, 21, 11)
  344.    CALL PrtScrn("    Current Video Page: " + STR$(VPage), 11, 21, 11)
  345.    CALL PrtScrn("     Number of Columns: " + STR$(VCol), 12, 21, 11)
  346.    CALL PrtScrn("     Cursor Start Line: " + STR$(CStrt), 13, 21, 11)
  347.    CALL PrtScrn("      Cursor Stop Line: " + STR$(CStp), 14, 21, 11)
  348.    CALL PrtScrn("      Cursor Attribute: " + STR$(CAtt), 15, 21, 11)
  349.    CALL PrtScrn("   Current DOS Version:  " + Dver$, 16, 21, 11)
  350.    CALL PrtScrn("  Size of B7T-DEMO.EXE: " + STR$(FSize&) + " Bytes", 17, 21, 11)
  351.    CALL PrtScrn("Number of Serial Ports: " + STR$(ComP), 18, 21, 11)
  352.    CALL PrtScrn(" Coprocessor Installed:  " + CP$, 19, 21, 11)
  353.    CALL Delay(60, 0, Mouse)
  354.    CALL DoWindow(9, 12, 7, 57, 13, 5, 0, prompt$, 3)
  355.    FOR row = 11 TO 12
  356.       READ line$
  357.       CALL PrtScrn(line$, row, 18, 15)
  358.    NEXT row
  359.    CALL Delay(60, 0, Mouse)
  360.    
  361. '----------------------------------------------------------------------------
  362. 'Mouse Services
  363. '----------------------------------------------------------------------------
  364.  
  365.    mver$ = b1$ + "Mouse Driver ver. " + ver$ + "  -  "
  366.    mstat$ = mver$ + "With" + STR$(buttons) + " buttons installed" + b2$
  367.    sctr = Ctr(mstat$)
  368.  
  369.    CLS
  370.    CALL DoWindow(1, 1, 25, 80, 30, 5, 0, "B7Tool", 2)
  371.    CALL DoWindow(2, 31, 3, 20, 31, 1, 0, "", 0)
  372.    CALL PrtScrn("Mouse Services", 3, 34, 31)
  373.    CALL DoWindow(5, 5, 10, 35, 12, 5, 0, "Mouse State #1", 2)
  374.    CALL DoWindow(7, 14, 3, 18, 12, 1, 0, "", 0)
  375.    CALL DoWindow(5, 42, 10, 35, 12, 5, 0, "Mouse State #2", 2)
  376.    CALL DoWindow(16, 7, 6, 68, 115, 5, 3, "", 0)
  377.    FOR row = 17 TO 20
  378.       READ line$
  379.       CALL PrtScrn(line$, row, 10, 112)
  380.    NEXT row
  381.    CALL PutScrn(ScrnBuf(0))
  382.    IF Mouse THEN
  383.       CALL PrtScrn(mstat$, 25, sctr, 30)
  384.       CALL MouseLimits(6, 6, 13, 38, 1)                 ' -------------------
  385.       CALL MouseLocate(11, 22, 1)                       '
  386.       CALL MouseCursor(9, 7, 30)                        '
  387.       CALL MouseReset(2)                                ' Save mouse state #1
  388.       CALL MouseVisible(1)                              ' Mouse pointer on
  389.       DO
  390.          CALL MouseClick(lft, mid, rgt)                 ' Typical wait for a
  391.       LOOP UNTIL lft OR rgt                             ' mouse button
  392.       IF rgt THEN
  393.          CALL MouseLimits(6, 43, 13, 75, 1)             ' -------------------
  394.          CALL MouseLocate(11, 59, 1)                    '
  395.          CALL MouseCursor(14, 0, 24)                    '
  396.          CALL MouseReset(4)                             ' Save mouse state #2
  397.  
  398.          pos$ = mpos1$: Mode = 1
  399.          DO                                             ' Loop conditional to
  400.             CALL MouseClick(lft, mid, rgt)              ' mouse button
  401.             IF rgt AND switch THEN
  402.                CALL MouseVisible(0)                   ' Turn old cursor off
  403.                CALL MouseReset(5)                     ' Recall mouse state #2
  404.                CALL MouseVisible(1)                   ' Turn new cursor on
  405.                switch = FALSE
  406.             ELSEIF rgt THEN
  407.                CALL MouseVisible(0)                   ' Turn old cursor off
  408.                CALL MouseReset(3)                     ' Recall mouse state #1
  409.                CALL MouseVisible(1)                   ' Turn new cursor on
  410.                CALL PrtScrn("Black Hole", 8, 18, 12)
  411.                switch = TRUE
  412.             END IF
  413.             IF switch THEN                                   ' Mouse state #1
  414.                CALL MouseExclude(7, 14, 9, 31, 1)           ' Black hole area
  415.                CALL MousePosition(mr, mc, 1)                 ' Turn cursor on
  416.                IF mr < 7 OR mr > 9 OR mc < 14 OR mc > 31 THEN ' outside of
  417.                   CALL MouseVisible(1)                        ' excluded area
  418.                END IF
  419.             ELSE                                             ' Mouse state #2
  420.                IF lft THEN                                     ' Toggle modes
  421.                   IF Mode = 0 THEN
  422.                      pos$ = mpos1$: Mode = 1
  423.                   ELSE
  424.                      pos$ = mpos2$: Mode = 0
  425.                   END IF
  426.                END IF
  427.                CALL MousePosition(r, c, Mode)         ' Return mouse position
  428.                LOCATE 14, 50: COLOR 12, 0: PRINT USING pos$; r; c
  429.             END IF
  430.          LOOP UNTIL lft AND switch
  431.       END IF
  432.       CALL MouseVisible(0)
  433.       READ line$, line$
  434.    ELSE                                                 ' Print no mouse text
  435.       CALL PrtScrn("Black Hole", 8, 18, 12)
  436.       CALL DoWindow(21, 7, 4, 68, 12, 1, 0, CONT$, 3)
  437.       FOR row = 22 TO 23
  438.          READ line$: lctr = Ctr(line$)
  439.          CALL PrtScrn(line$, row, lctr, 14)
  440.       NEXT row
  441.       CALL Delay(60, 0, Mouse)
  442.       CALL GetScrn(ScrnBuf(0))
  443.    END IF
  444.    CALL DoWindow(8, 12, 11, 56, 6, 5, 0, prompt$, 3)
  445.    FOR row = 10 TO 16
  446.       READ line$: lctr = Ctr(line$)
  447.       IF row < 12 THEN att = 15 ELSE att = 10
  448.       CALL PrtScrn(line$, row, lctr, att)
  449.    NEXT row
  450.    CALL Delay(60, 0, Mouse)
  451.  
  452. '----------------------------------------------------------------------------
  453. 'Closing
  454. '----------------------------------------------------------------------------
  455.  
  456.    CLS
  457.    CALL DoWindow(1, 1, 25, 80, 71, 5, 0, "B7Tool Demo - Ver. 1.2a", 2)
  458.    CALL DoWindow(3, 6, 21, 69, 15, 5, 0, "", 3)
  459.    CALL PrtScrn(cpyr$, 25, 24, 71)
  460.    READ line$: lctr = Ctr(line$)
  461.    CALL PrtScrn(line$, 5, lctr, 12)
  462.    FOR row = 7 TO 19
  463.       READ line$: lctr = Ctr(line$)
  464.       CALL PrtScrn(line$, row, lctr, 14)
  465.    NEXT row
  466.    CALL PrtScrn(prompt$, 21, pctr, 10)
  467.    CALL Delay(90, 0, Mouse)
  468.  
  469. '----------------------------------------------------------------------------
  470. Terminate:
  471. '----------------------------------------------------------------------------
  472.   
  473.    IF Mouse THEN CALL MouseReset(0)
  474.  
  475.    ah = 7: al = 0                               ' Example of system Interrupt
  476.    bh = CAtt: bl = 0                            '  to clear a screen (ie. CLS)
  477.    ch = 0: cl = 0                               '  with int 10h function 7h
  478.    dh = 24: dl = 79                             '  (ah = scroll down)
  479.    InReg.ax = (ah * 256) + al                   ' Conversion of high and low
  480.    InReg.bx = (bh * 256) + bl                   '  byte for acceptance by PDS
  481.    InReg.cx = (ch * 256) + cl                   '
  482.    InReg.dx = (dh * 256) + dl                   '
  483.    CALL Interrupt(&H10, InReg, OutReg)          ' Returns nothing
  484.  
  485.    END
  486.  
  487.  
  488.    DATA "Welcome to the world of the"
  489.    DATA "B7Tool Library [B7T]"
  490.    DATA "ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ"," "
  491.    DATA "This program is set up to demonstrate  the"
  492.    DATA "features of the B7T Library.  This library"
  493.    DATA "is  designed  to  work with Microsoft (R),"
  494.    DATA "BASIC 7.x, PDS (C).   The source code  for"
  495.    DATA "this demo is provided so you  can  examine"
  496.    DATA "the  actual  usage  of these B7T routines."
  497.    DATA "             Shall we begin?"
  498.    DATA "This  program  detects  the presence of a"
  499.    DATA "mouse driver; version no."
  500.    DATA "Do  you wish to use your mouse throughout"
  501.    DATA "this demonstration?"," "
  502.    DATA "               (Y)  -  (N)"
  503.    DATA "First you will see the various windowing"
  504.    DATA "frame  styles and a demonstration of the"
  505.    DATA "screen save and restore routines.       "
  506.    DATA "B7Tool  offers a"
  507.    DATA "wide variety  of"
  508.    DATA "frame styles."
  509.    DATA "----------------"
  510.    DATA "The window title"
  511.    DATA "can be placed at"
  512.    DATA "top or bottom.  "
  513.    DATA "Each window screen was saved with PutScrn()."
  514.    DATA "We will now use  GetScrn()  and recall those"
  515.    DATA "nine screens.                               "
  516.    DATA "Now  we will add a .33 second delay  and"
  517.    DATA "again recycle through the saved screens."
  518.    DATA "**  Window Shadow Styles  **"
  519.    DATA "left side and bottom"
  520.    DATA "*  black in color  *"
  521.    DATA "right side and bottom"
  522.    DATA "*  black in  color  *"
  523.    DATA "left side and bottom"
  524.    DATA "*   tinted black   *"
  525.    DATA "right side and bottom"
  526.    DATA "*   tinted  black   *"
  527.    DATA "left side and bottom"
  528.    DATA "* shadow character *"
  529.    DATA "right side and bottom"
  530.    DATA "* shadow  character *"
  531.    DATA "So far this demonstration has used  the  following"
  532.    DATA "routines with a combined number of 72 occurrences."," "
  533.    DATA "   MouseStatus() - DoWindow() - PrtScrn()   "
  534.    DATA "   Delay() - PutScrn() - GetScrn() - Ctr()  "
  535.    DATA "Next is a demonstration of the mouse and key"
  536.    DATA "driven pull-down bar menu routine of B7Tool."
  537.    DATA "Next is a list of equipment and system"
  538.    DATA "information returned by B7Tool routines."
  539.    DATA "Next will be a demonstration of  the  various"
  540.    DATA "mouse services offered in the B7Tool Library."
  541.    DATA "The right mouse button will toggle between the separate mouse"
  542.    DATA "states.  While in mouse state #2,  the left mouse button will"
  543.    DATA "toggle  between  modes  for  MousePosition().  While in mouse"
  544.    DATA "state #1, the left mouse button will exit Mouse Services.    "
  545.    DATA "Sorry, but a mouse driver is not detected by this program."
  546.    DATA "A demonstration of the mouse services will not be done."
  547.    DATA "The following routines are used in the mouse"
  548.    DATA "services demonstration.                     ", " "
  549.    DATA "MouseStatus()    MouseReset()     MousePosition()"
  550.    DATA "MouseLocate()    MouseLimits()    MouseVersion() "
  551.    DATA "MouseVisible()   MouseExclude()   MouseCursor()  "
  552.    DATA "MouseClick()                                     "
  553.    DATA "  ==   B7Tool Library (B7T)   =="
  554.    DATA "This concludes the short demonstration of the features"
  555.    DATA "offered by the B7Tool Library.  Nearly  every  routine"
  556.    DATA "in  B7T  was used in this demo.  Over 2/3 of the lines"
  557.    DATA "of code in this program contain  a  B7Tool  statement."
  558.    DATA "The  features  offered  in  this library are common to"
  559.    DATA "most programming needs.  The  prototypes  and  a  full"
  560.    DATA "description  of  these  routines are documented in the"
  561.    DATA "file B7TOOL.DOC.  Information on the object files  and"
  562.    DATA "source codes for the routines in B7T is also available"
  563.    DATA "in this file.                                         "," "
  564.    DATA "Microsoft is a registered  trademark of the  Microsoft"
  565.    DATA "Corporation.  Good Luck and Enjoy!                    "
  566.  
  567. '============================================================================
  568. '
  569. '      The source code for  this  demonstration  is  quite  simple.  It
  570. '      should, however, give you a better idea as to the practical  use
  571. '      of  the  B7Tool  library routines.  B7T is designed to be a lib-
  572. '      rary containing the routines generally needed most.   The  mouse
  573. '      services, DoWindow, & BarMenu are the backbone of  this library.
  574. '      There's few programs, large  or  small,  that  couldn't  utilize
  575. '      these features.
  576. '
  577. '      The   complete   B7Tool  Library  is  distributed  as  the  file
  578. '      B7T12.EXE and contains the following files:
  579. '
  580. '         B7T.LIB         B7T.QLB         B7T.BI        B7TOOL.DOC
  581. '         B7T-DEMO.BAS    B7T-DEMO.EXE    VENDOR.DOC    README.TXT
  582. '         REGISTER.TXT    FILE_ID.DIZ
  583. '
  584. '      Information  on  the availability of the source and object codes
  585. '      for B7Tool is found in  the  file  B7TOOL.DOC.  You  can  always
  586. '      obtain the latest version of B7Tool from CompuServe (R), IBMPRO,
  587. '      LIB 4 (Browse B7T) or directly from CareWare.
  588. '
  589. '      B7Tool is copyrighted to the author with all rights reserved and
  590. '      is  distributed  as  a Shareware product.  If you acquire B7Tool
  591. '      and decide to use its services beyond a  30  day  trail  period,
  592. '      than  a  registration fee of $25.00 (US) is required.  This fee,
  593. '      when paid, entitles you  to  full  usage  and  support  of  this
  594. '      product,  and  the  latest  version of B7Tool and individual QBJ
  595. '      modules on disk.
  596. '
  597. '                                           _______
  598. '                                      ____|__     |                (R)
  599. '      R. J. Crouch                 --|       |    |-------------------
  600. '      CareWare                       |   ____|__  |  Association of
  601. '      10217 Ridge View Dr.           |  |       |_|  Shareware
  602. '      Grass Valley, CA  95945        |__|   o   |    Professionals
  603. '      (916) 477-6024               -----|   |   |---------------------
  604. '      CIS - 74270,516                   |___|___|    MEMBER
  605. '
  606. '
  607. '      Microsoft is registered trademark of the Microsoft Corporation.
  608. '
  609. '============================================================================
  610.  
  611.